<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <title>Textarea Maxlength</title>

</head>
<body>
<textarea rows="5" cols="20" maxlength="100"></textarea>
<script type="text/javascript">
$(function(){
	$('textarea').each(function(){
		var $this = $(this);
		var max = parseInt($this.attr('maxlength'), 10);
		$this.keyup(function(){
			if($this.val().length > max) {
				$this.val($this.val().substr(0, max));
			}
		});
	});
});
</script>
</body>
</html>